<template>
  <div>
    <div class="table">
      <el-table
        border
        size="mini"
        ref="multipleTable"
        :data="Therepairorder"
        :header-cell-style="{
          color: '#fff',
          background: '#6090EC',
          fontSize: '11px',
          fontWeight: 'normal',
        }"
        :row-style="{ height: '40px' }"
        tooltip-effect="dark"
        style="width: 100%"
      >
        <el-table-column prop="caseId" label="工单号" width="100">
        </el-table-column>
        <el-table-column prop="caseType" label="工单类型" width="144">
          <template slot-scope="scope">
            <template v-if="scope.row.caseType == 'hotel'">酒店</template>
            <template v-if="scope.row.caseType == 'flight'">机票</template>
            <template v-if="scope.row.caseType == 'service'">贵宾厅</template>
            <template v-if="scope.row.caseType == 'train'">火车票</template>
            <template v-if="scope.row.caseType == 'customer'">会员</template>
          </template>
        </el-table-column>
        <el-table-column prop="caseSubject" label="工单标题" width="84">
        </el-table-column>
        <el-table-column prop="caseContent" label="工单内容" width="84">
        </el-table-column>
        <el-table-column prop="createEmployeeId" label="创建人" width="84">
        </el-table-column>
        <el-table-column prop="dept" label="创建部门" width="84">
        </el-table-column>
        <el-table-column prop="caseCreateTime" label="创建时间">
        </el-table-column>
        <el-table-column prop="receivingDepartment" label="接收部门" width="72">
        </el-table-column>
        <el-table-column prop="receivePost" label="接受岗位" width="72">
        </el-table-column>
        <el-table-column prop="receiver" label="接收人" width="72">
        </el-table-column>
        <el-table-column prop="orderId" label="订单号" width="80">
        </el-table-column>
        <el-table-column prop="pri" label="紧急" width="70"> </el-table-column>
        <el-table-column prop="caseStatus" label="状态" width="80">
          <template slot-scope="scope">
            <template>
              {{
                scope.row.caseStatus == "1"
                  ? "处理完"
                  : scope.row.caseStatus == "2"
                  ? "废弃"
                  : "待处理"
              }}
            </template>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="name" label="操作" width="90">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  style="background-color: #6090ec; color: #fff"
                  @click="(details = true), Workorderdetails(scope.row)"
                  >详情</el-button
                >
              </template>
            </el-table-column> -->
      </el-table>
    </div>
      <!-- <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[10, 15, 20]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pageTotal"
    >
    </el-pagination> -->
  </div>
</template>

<script>
export default {
  props: ["message"],

  data() {
    return {
      // 查询传参
      // Thequery: {
      //   caseId: "",
      //   caseStatus: "",
      //   afterTime: "",
      //   agoTime: "",
      //   orderId: "",
      //   orderType: "",
      // },
      // 工单列表
      Therepairorder: [],
       pageSize: 10,
      currentPage: 1,
      pageTotal: 0,

    };
  },
  methods: {
    //    //分页
    // handleSizeChange(value) {
    //   console.log("1", value);
    //   localStorage.setItem("pageSize", value);
    //   localStorage.setItem("pageNum", 1);
    //   this.getbackGuaranteeCaseById();
    //   this.pageSize = value;
    // },
    // handleCurrentChange(value) {
    //   console.log("2", value);
    //   // debugger;
    //   localStorage.setItem("pageNum", value);
    //   localStorage.setItem("pageSize", this.pageSize);
    //   this.getbackGuaranteeCaseById();
    //   // orders = res.data;
    // },

    // search() {
    //   localStorage.setItem("pageNum", this.currentPage);
    //   localStorage.setItem("pageSize", 10);
    //   this.getbackGuaranteeCaseById();
    // },
    // 查询工单
    getbackGuaranteeCaseById() {
        localStorage.setItem("pageNum", 1);
      localStorage.setItem("pageSize", 5);
      console.log(this.message)
      this.$axios
        .getbackGuaranteeCaseById({
          // caseId: this.Thequery.caseId,
          //  caseId: this.message.customerCard,
          // caseStatus: this.Thequery.caseStatus,
          // orderId: this.Thequery.orderId,
          // orderType: this.Thequery.orderType,
          phone: this.message.phoneOne,
        })
        .then((res) => {
            localStorage.setItem("pageNum", 1);
      localStorage.setItem("pageSize",10);
          console.log(res);
          if (res.code == "200") {
            // 工单列表数据
            this.Therepairorder = res.data;
            this.pageTotal = res.total
          }
        });
    },
  },
  mounted() {
    // this.getbackGuaranteeCaseById();
  },
};
</script>
<style scoped>
.table {
  padding: 0;
}
</style>
